//
//  SingletonSocket.swift
//  flowerpot
//
//  Created by fyname on 15/11/30.
//  Copyright © 2015年 senhe. All rights reserved.
//

import Foundation
import Starscream


class SingletonFriendSocket{
    
    let webSocket = WebSocket(url: NSURL(string: "ws://\(Common.localhost):8088/weijia-wim-web/friend/getfriends")!)
    
    class var sharedInstance : SingletonFriendSocket {
        struct StaticFriend {
            static let instance:SingletonFriendSocket = SingletonFriendSocket()
        }
        if(!StaticFriend.instance.webSocket.isConnected){
            StaticFriend.instance.webSocket.connect()
        }
        return StaticFriend.instance
    }
    
}
